//
//  MFAPMNetMonitorURLSession.h
//  MFAPMManager
//
//  Created by zhang liyu on 2019/6/27.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface MFAPMNetMonitorURLSession : NSObject

/**
 初始化时传入的configuration
 */
@property (atomic, readonly, copy) NSURLSessionConfiguration *configuration;

/**
 内部生成的URLSession
 */
@property (atomic, readonly, strong) NSURLSession *session;

#pragma mark - Install Actions

/**
 初始化URLSession
 
 @param configuration 初始化时传入的配置选项
 @return 创建好的本类对象
 */
- (instancetype)initWithConfiguration:(nullable NSURLSessionConfiguration *)configuration;

#pragma mark - DataTask Actions

/**
 获取数据Task
 
 @param request 创建Task时所需的Request
 @param delegate 创建Task时所需回调的代理对象
 @param modes 当前Task需要运行的RunloopMode数组
 @return 创建好的Task对象
 */
- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request delegate:(id<NSURLSessionDataDelegate>)delegate modes:(NSArray *)modes;

@end

NS_ASSUME_NONNULL_END
